<template>
	<view class="goods-list">
		<view @click="goDetail(item.id)" class="goods-item" v-for="item in goods" :key="item.id">
			<image
				src="https://res.vmallres.com/pimages/uomcdn/CN/pms/202203/gbom/6941487250882/428_428_A1308212EBC5B717A9110FFF9906CC91mp.png"
				mode=""></image>
			<view class="price">
				<text>￥{{item.sell_price}}</text>
				<text>￥{{item.market_price}}</text>
			</view>
			<view class="name">
				{{item.title}}
			</view>
		</view>
	
	</view>
</template>

<script>
	export default {
		name:'goods-list',
		props:['goods'],
		data() {
			return {
				
			};
		},
		created:function(){
			
		},
		methods:{
			goDetail(id){
				this.$emit('itemClick',id)
			}
		}
	}
</script>

<style lang="scss">
.goods-list {
				padding: 0 15rpx;
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;

				.goods-item {
					background-color: #FFFFFF;
					width: 355rpx;
					margin: 10rpx 0;
					padding: 15rpx;
					box-sizing: border-box;

					image {
						width: 80%;
						height: 142px;
						margin: 0 auto;
						display: block;
					}

					.price {
						color: $uni-main-color;
						font-size: 36rpx;
						margin: 20rpx 0 5rpx;

						text:nth-child(2) {
							color: #CCCCCC;
							font-size: 28rpx;
							margin-left: 17rpx;
							text-decoration: line-through;
						}
					}

					.name {
						font-size: 28rpx;
						line-height: 50rpx;
						padding: 10rpx 0 15rpx;
					}
				}
			}
</style>
